<template>
  <div class="list-view">
    创建任务业务逻辑
    <el-button type="primary" @click="handleFinish">完成创建任务</el-button>
  </div>
</template>

<script setup lang="ts">

defineOptions({
  name: "TaskView",
  components: {}
});


import { useCreateTaskStore } from "../store/createTaskStore";
import { routerLinkTestView } from "../api/task/index";

const dataEvent = (data: any) => {
  console.log("子组件收到数据了", data);
}

defineExpose({
  dataEvent
})

// 2. 实例化组合式 store
const createTaskStore = useCreateTaskStore();

// 验证存储结果
console.log("存储后 Pinia 中的值：", createTaskStore.sendCreateTaskCmd);

const handleFinish = async () => {
  await routerLinkTestView("/testView?taskId=init");
}

</script>

<style lang="scss" scoped>
.list-view {
  padding: 12px;
}
</style>
